import {createBrowserRouter} from 'react-router-dom'
import App from '../App'
import Home from '../pages/home/Home'
const router =createBrowserRouter([
    {
        path:'/',
        element:<App></App>,
        children:[
            {index:true,element:<Home></Home>},
            {
                path:'home',
                lazy:async()=>{
                   const {default:Home} =await import ('../pages/home/Home')
                   return{
                    element:<Home></Home>
                   }
                }
            }
        ]

    },
    {
        path:'/login',
        lazy:async()=>{
           const {default:Login} =await import ('../pages/login/Login')
           return{
            element:<Login></Login>
           }
        }
    },
    {
        path:'/ticket',
        lazy:async()=>{
           const {default:Ticket} =await import ('../pages/ticket/Ticket')
           return{
            element:<Ticket></Ticket>
           }
        }
    },
    {
        path:'/my',
        lazy:async()=>{
           const {default:My} =await import ('../pages/my/My')
           return{
            element:<My></My>
           }
        }
    },
    {
        path:'/ck',
        lazy:async()=>{
           const {default:Ck} =await import ('../pages/ck/Ck')
           return{
            element:<Ck></Ck>
           }
        }
    }
])

export default router